{literal}
<script>
function include_once_javascript(fileUrl) {
    if (typeof(alreadyIncluded) == "undefined" ){  
        alreadyIncluded = [];
    }
    var found = false;
    for (i = 0; i < alreadyIncluded.length; i++){//alert(i);
        if (alreadyIncluded[i] ==  fileUrl){
            found = true;
            break;
        }          
    }
    if (found == true){//alert(found);
        return true;           
    }
    else {
        var script = document.createElement("script");
        var head   = document.getElementsByTagName('head').item(0);
        root = document.URL.replace(/index.php/g, '');
        script.src = root + 'js/' + fileUrl + '.js';
        head.appendChild(script);
        alreadyIncluded[alreadyIncluded.length] = fileUrl; //alert ('included');
        return true;
    }
}
</script>
{/literal}
